<?php

/******************************************
 * File:			lib_images.php
 * Version:			1.0.0
 * Last modified:	25/10/2009
 * Last modifier:	Hugo Lavigne
 *****************************************/
 
Function get_new_image_size($width=NULL, $height=NULL, $percent, $mode)
{
  if (($mode == "a") && ($percent > 0))
    $percent = 100 + $percent;
  elseif (($mode == "r") && ($percent < 100))
    $percent = 100 - $percent;
  else
  {
    $res['width'] = $width;
    $res['height'] = $height;
    return ($res);
  }
    
  $width = ($width * $percent) / 100;
  $height = ($height * $percent) / 100;
  
  $res['width'] = $width;
  $res['height'] = $height;
  
  return ($res);
}

?>